import requests


class ZsxjRequest:

    def search(self, keyword):
        headers = {
            "Accept-Language": "en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4",
            "dj-client": "android",
            "dj-signature": "9d73e6b431434277a0d3cf501cd0a7030aa594b6",
            "host": "fund.xueqiu.com",
            "client_id": "3XmoY2upy",
            "X-App-Version": "14.1.5",
            "client_secret": "Nh3H6PNpNPiaHhRE",
            "xq-uid": "7696721958",
            "User-Agent": "Fund Android 6.93.0",
            "dj-anonym-uid": "-1",
            "xq-dj-token": "8b136db4cf68d86f21f59a8d18916665ab98eb41",
            "dj-flavor": "xueqiu",
            "X_App_ID": "Xueqiu Android",
            "dj-timestamp": "1664490963094",
            "dj-device-id": "1HUAWEI18f8bc7b09f98364b02f8baec4a62ce5",
            "dj-version": "6.93.0",
            "dj-app-package": "com.xueqiu.android",
            "dj-device-oaid": ""
        }
        url = "https://fund.xueqiu.com/fundx/base/index/search"
        params = {
            "key_word":keyword,
            "size": 20
        }
        r = requests.get(url, headers=headers,params=params, verify=False)
        return r
